<?php


namespace app\user\controller;


use think\Controller;
use think\facade\Request;

class KuaishouApply extends Controller
{
    protected $middleware = [
        'app\http\middleware\checkTTUserToken::class',
    ];

    //添加一条申请记录
    public function create()
    {
        $user_id= Request::param('user_id');

        //先判断是否有申请记录
        $res=\app\common\model\KuaishouApply::where([
            'user_id'=>$user_id,
            'status'=>0,
        ])->find();

        if($res){
            $this->result('',200,'您有正在申请当中');
        }else{
            $data=Request::only([
                'user_id'=>0,
                'fans'=>0,
                'ks_id'=>0,
                'mobile'=>0,
                'wechat'=>0,
                'status'=>0,
            ]);
            $res2=\app\common\model\KuaishouApply::create($data);
            //返回接口数据
            $this->result($res,200,'申请提交成功');
        }
    }


}